package app.context;

import org.springframework.security.oauth2.provider.OAuth2Authentication;

public class OAuth2AuthenticationContextHolder {
    private static ThreadLocal<OAuth2Authentication> oAuth2AuthenticationContext = new ThreadLocal<>();

    public static OAuth2Authentication getUserAuthentication() {
        return oAuth2AuthenticationContext.get();
    }

    public static void setUserAnthentication(OAuth2Authentication authentication) {
        oAuth2AuthenticationContext.set(authentication);
    }

    public static void cleanUserAnthentication() {
        oAuth2AuthenticationContext.remove();
    }


}
